package com.banyou.banyou.util;

/**
 * Created by liubin on 2017/5/10.
 */

public class TimeFormatUtil {

    /**
     * 毫秒转化时分显示
     */
    public static String formatTime(Long ms) {

        int ss = 1000;
        int mi = ss * 60;
        int hh = mi * 60;

        long hour = ms / hh;
        long minute = (ms - hour * hh) / mi;

        StringBuilder sb = new StringBuilder();

        if (hour > 0) {
            sb.append(hour + "小时");
        }
        if (minute > 0) {
            sb.append(minute + "分");
        }
        return sb.toString();
    }

}
